﻿<%@ Page Title="ХочуБукет.RU - описание продукта" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="ProductDetails.aspx.cs" Inherits="FlowersStore.ProductDetails" %>

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="AroundMainMenu">
        <div class="LeftMenuCol">
        </div>
        <div class="menuCol">
            <div class="MainMenuSearch">
                <div class="MainMenueSearchTool">
                    <asp:TextBox ID="TextBoxSearch" runat="server" Width="168px" Height="32px" BorderStyle="None"
                        BorderWidth="0" CssClass="SearchField" Font-Size="Medium" ToolTip="Введите цветок для поиска">Поиск</asp:TextBox>
                </div>
                <div class="MainMenuSearchGlass">
                    <a style="text-decoration: none" href="Search.aspx">
                        <img onclick="SearchGo" alt="Поиск" src="Styles/Images/Search.png" />
                    </a>
                </div>
            </div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:TreeView ID="TreeViewMainMenu" runat="server" OnSelectedNodeChanged="TreeViewMainMenu_SelectedNodeChanged"
                        ShowExpandCollapse="False" RootNodeStyle-CssClass="MenuRootNodeStyle">
                        <RootNodeStyle CssClass="MenuRootNodeStyle" />
                        <LeafNodeStyle HorizontalPadding="24" CssClass="MenuLeafNodeStyle" />
                    </asp:TreeView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <div class="mainContent">
        <asp:HyperLink ID="btnBack" runat="server" Text="Назад" />
        <asp:SqlDataSource ID="SqlDataSourceTogether" runat="server" ConnectionString="<%$ ConnectionStrings:FlowerStoreConnectionString2 %>"
            SelectCommand="GetBuyingTogetherProducts" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:QueryStringParameter Name="ProductId" QueryStringField="product" Type="Int64" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:LinqDataSource ID="ProductLinqDataSource" runat="server" ContextTypeName="FlowersStore.FlowerStoreDataContext"
            EntityTypeName="" TableName="Products" Where="Product_id == @Product_id">
            <WhereParameters>
                <asp:QueryStringParameter Name="Product_id" QueryStringField="product" Type="Int64" />
            </WhereParameters>
        </asp:LinqDataSource>
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="Product_id" DataSourceID="ProductLinqDataSource">
            <ItemTemplate>
                <tt class="ProductName">
                    <asp:Label ID="Product_nameLabel" runat="server" Text='<%# Eval("Product_name") %>' />
                </tt>
                <br />
                <tt class="ProductArticle">Артикул:
                    <asp:Label ID="Label_Product_article" runat="server" Text='<%# Eval("Product_article") %>' />
                </tt>
                <br />
                <div class="ProductView" runat="server">
                    <div style="margin-left: -5px; margin-top: 5px; text-align: center;">                    
                        <img alt="Цветок" src='<%# Eval("Product_imgUrl") %>' />
                    </div>
                </div>
                <div class="clear">
                </div>
                <div style="width: 470px; text-align: center;">
                    <p id="ProductDesc" class="ProductDescriptionOne" runat="server">
                        <%# Eval("Product_description") %></p>
                </div>
                <div>
                    <tt class="ProductPrice">
                        <asp:Label ID="Label_ProductPrice" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Product_price","{0:n0}") %>' />
                        руб. </tt>&nbsp;&nbsp;
                    <asp:TextBox ID="TextBoxNumber" runat="server" BorderColor="#0099CC" BorderStyle="Outset"
                        BorderWidth="3px" Width="40px" Wrap="False" EnableTheming="True">1</asp:TextBox>
                    <asp:NumericUpDownExtender ID="NumericUpDownExtender" runat="server" Enabled="True"
                        Maximum="1000" Minimum="1" RefValues="" ServiceDownMethod="" ServiceDownPath=""
                        ServiceUpMethod="" Tag="" TargetButtonDownID="" TargetButtonUpID="" TargetControlID="TextBoxNumber"
                        Width="80">
                    </asp:NumericUpDownExtender>
                    шт. <span class="ProductBuy">
                        <asp:ImageButton AlternateText="В корзину" ImageUrl="Styles/Images/InCart.png" ID="btnInCart"
                            OnClick="btnInCart_Click" runat="server" />
                    </span>
                </div>
            </ItemTemplate>
        </asp:FormView>
        <br/>
        <tt class="AdminTitle">С этим товаром также дарят:</tt>
        <br />
        <asp:ListView ID="ListView_Together" runat="server" DataKeyNames="Product_id" DataSourceID="SqlDataSourceTogether"
            GroupItemCount="3">
            <EmptyDataTemplate>
                Будьте первым, кто попадёт в статистику счастливых покупателей!
            </EmptyDataTemplate>
            <GroupTemplate>
                <tr id="itemPlaceholderContainer" runat="server">
                    <td id="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td id="Td1" runat="server" style="padding: 15px;">
                    <tt class="ProductName">
                        <asp:Label ID="Product_nameLabel" runat="server" Text='<%# Eval("Product_name") %>' />
                    </tt>
                    <br />
                    <div class="ProductPreView" runat="server">
                        <div style="margin-left: -4px; margin-top: 5px; text-align: center;">
                        <a href="ProductDetails.aspx?product=<%# Eval("Product_id") %>">
                            <img alt="Цветок" src='<%# Eval("Product_thimbnailUrl") %>' /></a>
                        </div>
                    </div>
                    <br />
                    <div class="clear">
                    </div>
                    <div>
                        <tt class="ProductPrice">
                            <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Product_price","{0:n0}") %>' />
                            руб. </tt><span class="ProductBuy">
                                <asp:ImageButton AlternateText="В корзину" ImageUrl="Styles/Images/InCart.png" ID="btnInCart"
                                    OnClick="btnInCart_Click" runat="server" CommandArgument='<%# Eval("Product_id") %>' />
                            </span>
                    </div>
                </td>
                <%--<td id="Td1" runat="server" style="padding: 10px;">
                    <tt class="ProductName">
                        <asp:Label ID="Product_nameLabel" runat="server" Text='<%# Eval("Product_name") %>' />
                    </tt>
                    <div id="Div1" class="ProductPreView" runat="server">
                        <div style="margin-top: 10px; text-align: center;">
                            <img alt="Цветок" src='<%# Eval("Product_thimbnailUrl") %>' />
                        </div>
                    </div>
                    <div class="clear"></div>
                <tt class="ProductPriceOne">
                    <asp:Label ID="Product_priceLabel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Product_price","{0:n0}") %>' />
                    руб. </tt></td>--%>
            </ItemTemplate>
            <LayoutTemplate>
                <table cellspacing="0" id="ProductTable" runat="server">
                    <tr id="Tr1" runat="server">
                        <td id="Td2" colspan="2" runat="server">
                            <table id="groupPlaceholderContainer" runat="server" border="0" style="">
                                <tr id="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
        </asp:ListView>
    </div>
    <div class="clear" />
</asp:Content>
